using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace RiceShop.Models
{
    /// <summary>
    /// 订单商品实体类
    /// </summary>
    [Table("OrderGoods")]
    public class OrderGoods
    {
        /// <summary>
        /// 订单商品ID
        /// </summary>
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 订单ID
        /// </summary>
        public long OrderId { get; set; }

        /// <summary>
        /// 订单编号（用于显示）
        /// </summary>
        [Required]
        [StringLength(50)]
        public string OrderNo { get; set; } = string.Empty;

        /// <summary>
        /// 商品SPU ID
        /// </summary>
        [Column("spuId")]
        public long SpuId { get; set; }

        /// <summary>
        /// 商品标题
        /// </summary>
        [Column("goodTitle")]
        [StringLength(255)]
        public string? GoodTitle { get; set; }

        /// <summary>
        /// 商品单价
        /// </summary>
        [Column("salePrice", TypeName = "decimal(18,2)")]
        public decimal SalePrice { get; set; }

        /// <summary>
        /// 商品主图
        /// </summary>
        [Required]
        [StringLength(500)]
        public string PrimaryImage { get; set; } = string.Empty;

        /// <summary>
        /// 购买数量
        /// </summary>
        public int Quantity { get; set; }


        /// <summary>
        /// SKU ID
        /// </summary>
        [Column("skuId")]
        public long SkuId { get; set; }

        /// <summary>
        /// 规格值组合
        /// </summary>
        [Column("specValues")]
        public string? SpecValues { get; set; }

        /// <summary>
        /// 商品编码
        /// </summary>
        [Column("code")]
        [StringLength(50)]
        public string? Code { get; set; }

        /// <summary>
        /// 商品单位
        /// </summary>
        [Column("unit")]
        [StringLength(20)]
        public string? Unit { get; set; }

        /// <summary>
        /// 划线价
        /// </summary>
        [Column("linePrice", TypeName = "decimal(18,2)")]
        public decimal? LinePrice { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsDeleted { get; set; }


    }
}